<?php
class Model_Config extends CI_Model
{	
	function getKey($key)
	{
		$this->db->from('setting');	
		$this->db->where('key',$key);
		$query = $this->db->get();
		
		if($query->num_rows == 0)
		{
			return false;
		}
		
		$row = $query->row_array();
		
		if($row['serialized'] == 0)
		{
			return $row['value'];
		}
		else
		{
			return unserialize($row['value']);
		}
		
		
	}
	
	function getLanguageID($code)
	{
		$this->db->from('language');
		$this->db->where('code', $code);
		
		$query = $this->db->get();
		
		return $query->row('language_id');
	}
	 
}

?>